using System.Collections;
using System.Workflow.Activities;
using WCSFContrib.PageFlow.WorkflowFoundation.Activities;

namespace PageFlowWithShoppingCartQuickstart.Store.PageFlows
{
	public sealed partial class StorePageFlow : PageFlow
	{
		public StorePageFlow()
		{
			InitializeComponent();
		}

		private void AllowCheckout(object sender, ConditionalEventArgs e)
		{
			bool allowCheckout = false;

			if (UserDataStore.ContainsKey("Cart"))
			{
				if (((IList) UserDataStore["Cart"]).Count < 1)
				{
					allowCheckout = true;
				}
			}

			e.Result = allowCheckout;
		}
	}
}